package com.marktotop.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.marktotop.entity.system.ImageAttachment;
import com.marktotop.error.SystemException;
import com.marktotop.response.ResultBean;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author MarkToTop
 * @since 2021-07-12
 */
public interface IImageService extends IService<ImageAttachment> {


    /**
     * 上传图片文件 返回上传地址
     * @param file
     * @return
     * @throws IOException
     * @throws SystemException
     */
    String uploadImage(MultipartFile file) throws IOException, SystemException;


    /**
     * 删除图片资源
     *
     * @param id
     * @throws SystemException
     */
    void deleteImage(Long id) throws SystemException;


    /**
     * 分页展示上传的图片资源
     *
     * @param pageNum
     * @param pageSize
     * @param image
     * @return
     */
    ResultBean findImageList(Integer pageNum, Integer pageSize, ImageAttachment image);
}
